<div style="width:100%; float:left; margin-bottom:10px; text-align:right;">
	<form action="<?=Yii::app()->createUrl('order/index')?>" name="jobForm" id="jobForm" method="get">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="13%" style="text-align:right;"><?php echo $labels['ProductModel']; ?></td>
			<td width="20%"><input type="text" name="ProductModel" value="<?php if(isset($search['ProductModel']))echo $search['ProductModel'];?>" id="ProductModel" class="input_size2" /></td>
			<td width="13%" style="text-align:right;"><?php echo $labels['ProductName']; ?></td>
			<td width="20%"><input type="text" name="ProductName" value="<?php if(isset($search['ProductName']))echo $search['ProductName'];?>" id="ProductName" class="input_size2" /></td>	
			<td width="13%" style="text-align:right;"><?php echo $labels['NIDNo']; ?></td>
			<td><input type="text" name="NIDNo" value="<?php if(isset($search['NIDNo']))echo $search['NIDNo'];?>" id="NIDNo" class="input_size2" /></td>
		</tr>
		<tr>
			<td style="text-align:right;"><?php echo $labels['ProductDetail']; ?></td>
			<td colspan="4">
				<input type="text" name="ProductDetail" value="<?php if(isset($search['ProductDetail']))echo $search['ProductDetail'];?>" id="ProductDetail" size="60" />				
			</td>			
			<td style="text-align:right;"><input type="image" src="images/go.png" name="jobSub" id="jobSub" value="Go" /></td>
		</tr>		
	</table>		
		<input type="hidden" name="r" value="admin/addMulti" />
		<input type="hidden" name="groupId" value="<?=$_REQUEST['groupId']?>" />
	</form>
</div>
<form name='multi' id="multi" method="post">
<table cellspacing="0" cellpadding="0" width="100%" class="tbl" style="float:left;">
	<tr class="head">
		<td width="2%"><input type="checkbox" name="checkAll" id="checkAll"></td>
		<td width="8%"><?php echo $labels['ProductID']; ?></td>
		<td width="12%"><?php echo $labels['ProductModel']; ?></td>		
		<td width="10%"><?php echo $labels['NIDNo']; ?></td>
		<td width="25%"><?php echo $labels['ProductName']; ?></td>
		<td width="35%"><?php echo $labels['ProductDetail']; ?></td>
	</tr>
	<?php
    $i = 0;
    $cssArr = array(0 => 'even', 1 => 'odd', 2 => 'three');
    foreach ($rowTable as $item) {
        $trClass = $cssArr[$i % 3];
        $i++;
        ?>
	<tr class="<?= $trClass ?>">
		<td style="text-align:center;"><input type="checkbox" name="productIds[]" id="<?=$item->ProductID?>" value="<?=$item->ProductID?>"></td>
		<td>
			<?=$item->ProductID?>
		</td>
		<td>
			<?=$item->ProductModel?>
		</td>
		<td>
			<?=$item->NIDNo?>
		</td>
		<td>
			<?=$item->ProductName?>
		</td>
		<td>
			<?=$item->ProductDetail?>
		</td>
	</tr>
	<?php
    }
    ?>
</table>
<div id="pager" align="center">
<?php  
	$this->widget('CLinkPager',array(  
		'header'=>'',  
		'firstPageLabel' => '<<',
		'lastPageLabel' => '>>',
		'prevPageLabel' => '<',
		'nextPageLabel' => '>',
		'pages' => $pages,  
		'maxButtonCount'=>13  
		));  
?>
</div>
<div style="width:100%; float:left; margin-top:10px; text-align:center;">
	<div style="text-align:center;"><input type="button" onclick="fxl()" name="multiSub" value="关联" /></div>	
</div>
</form>
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
$(document).on('click','#checkAll',function() {
	var checked=this.checked;
	$("input[name='productIds\[\]']").each(function() {this.checked=checked;});
});
$(document).on('click', "input[name='productIds\[\]']", function() {
	$('#productIds').prop('checked', $("input[name='url\[\]']").length==$("input[name='productIds\[\]']:checked").length);
});
});
function fxl(){
	var val = false;
	$("input:checkbox[name='productIds\[\]']").each(function (){
    	if($(this).attr("checked")=='checked'){
			val = true;
        }
    });
	if(!val){
		alert('请选择需要关联的产品');
		return false;
	}
	document.forms.multi.submit();
}
/*]]>*/
</script>